package com.zyajac.springBootDemo.commonUtils;

import com.zyajac.springBootDemo.enums.ResultEnum;

import java.util.HashMap;
import java.util.Map;

public class CommonUtils {


    /**
      *
      * @author LZG
      * @date  2019/8/9 
      * @param  resultEnum code
      * @return 结果map
      **/
    public static Map<String , Object> setResult(ResultEnum resultEnum){
        Map<String , Object> result= new HashMap<>();
        result.put("state", resultEnum.state);
        return result;
    }

    /**
      *
      * @author LZG
      * @date  2019/8/9 
      * @param  resultEnum code
      * @return 结果map
      **/
    public static Map<String ,Object> setResult(ResultEnum resultEnum , String reason){
        Map<String , Object> result= new HashMap<>();
        result.put("state", resultEnum.state);
        result.put("reason", reason);
        return result;
    }
    
    
    
    
}
